package sgfapp.uno;




import org.json.JSONException;
import org.json.JSONObject;

import com.facebook.Request;
import com.facebook.Response;
import com.facebook.Session;
import com.facebook.model.GraphUser;

import sgfapp.entities.Usuario;
import sgfapp.notificaciones.GcmHandler;
import sgfapp.secure.secureManager;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ImageView;
import android.view.View.OnClickListener;
import sgfapp.webserv.*;

public class activity_menu  extends Activity implements OnClickListener {
	Button boton;
	Intent i;
	final static int cons=0;	
	ImageView BotonPublicar;
	ImageView BotonNotificaciones;
	ImageView BotonAltaBusqueda;
	
	
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
 
        return true;
    }
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
	    // Handle item selection
	    switch (item.getItemId()) {
	        case R.id.logout:

		    	Intent intent = new Intent(this, MainActivity.class);
		        startActivity(intent);
		        finish();
	        case R.id.action_info:

		    	Intent intent2 = new Intent(this, Info.class);
		        startActivity(intent2);
		       
	    }
	    return true;
	}
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.activity_menu);
		Log.e("GCMDemo","menu");
		
		BotonPublicar=(ImageView)findViewById(R.id.imageView2);
		BotonPublicar.setOnClickListener(this);
		BotonNotificaciones=(ImageView)findViewById(R.id.imageView3);
		BotonAltaBusqueda=(ImageView)findViewById(R.id.imageView4);
		//imv=(ImageView)findViewById(R.id.imageView1);
		//imv2=(ImageView)findViewById(R.id.imageView2);
		//boton=(Button)findViewById(R.id.button1);
		BotonPublicar.setOnClickListener(this);
		Log.e("GCMDemo","menu1");
		RegUser.context=this;
		
		
		
	
		
		
		//Usuario usuario=new Usuario();
		try
		{
		//new RegUser().execute();
		}
		catch(Exception e)
		{
			Log.e("GCMDemo","Error: "+e.toString());
		}
		Log.e("GCMDemo","EL mail del tipo: "+Usuario.Mail);
		


		
		Log.e("GCMDemo","menu2");

	}
	@Override
	public void onClick(View v) {
		int id;
		Log.e("GCMDemo","EL mail del tipo: "+Usuario.Mail);
		id=v.getId();
		switch(id)
		{
		case R.id.imageView2:
        	Log.e("GCMDemo","EL mail del tipo: "+Usuario.Mail);
	    	Intent intent = new Intent(v.getContext(), activity_alta.class);
	        startActivity(intent);
			break;
		}
		
	}


}	





